/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-16 07:51:51
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-16 13:34:55
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/components/animation_text.dart';
import 'package:flutter_data_center/controller/light_controller.dart';
import 'package:get/get.dart';

class LightStatistics extends StatelessWidget {
  const LightStatistics({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) => GetBuilder<LightController>(
        builder: (_controller) => Container(
          padding: EdgeInsets.only(left: 30, right: 30, top: 20),
          color: Theme.of(context).primaryColor,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                crossAxisAlignment: CrossAxisAlignment.end,
                children: [
                  AnimText(
                    number: _controller.total,
                    style: TextStyle(
                      fontSize: 64,
                      color: Colors.white,
                      height: 1,
                    ),
                  ),
                  SizedBox(width: 10),
                  Text(
                    "开启",
                    style: TextStyle(
                      fontSize: 18,
                      height: 4,
                      color: Colors.white,
                    ),
                  ),
                ],
              ),
              Column(
                crossAxisAlignment: CrossAxisAlignment.end,
                children: [
                  AnimText(
                    number: _controller.open,
                    style: TextStyle(
                      fontSize: 32,
                      color: Color(0xffABE8BF),
                    ),
                  ),
                  Text(
                    "总数",
                    style: TextStyle(
                      fontSize: 18,
                      color: Color(0xffABE8BF),
                    ),
                  )
                ],
              ),
            ],
          ),
        ),
      );
}
